<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="/static/admin/css/pintuer.css">
<link rel="stylesheet" href="/static/admin/css/admin.css">
<script src="/static/admin/js/jquery.js"></script>
<script src="/static/admin/js/pintuer.js"></script>
</head>
<body>

  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="{:url('number/add')}"> 添加内容</a> </li>
		<form method="get" action="" id="listform2">
        <li>搜索：</li>
       
           <li>
            <select name="tid" class="input" style="width:200px; line-height:17px;" onchange="changesearch()">
              <option value="">请选择班级</option>
                           <option value="2"   >电动吊篮</option>
			                <option value="1"   >移动脚手架</option>
			              </select>
          </li>	 
        
        <li>
          <input type="text" value='' placeholder="请输入搜索关键字" name="name" class="input" style="width:250px; line-height:17px;display:inline-block" />
                   <button class="button bg-main icon-check-square-o" type="submit" name="submit" value='1'> 提交</button></li>
      </ul></form>
    </div>

	<form method="post"  id="listform">
    <table class="table table-hover text-center">
      <tr>
        <th width="100" style="text-align:left; padding-left:20px;">编号</th>
        
        <th>楼栋信息</th>
        <th>楼栋地址</th>
        <th>楼栋图片</th>
		  
		
        
        <th width="310">操作</th>
      </tr>
      {foreach $list as $val}
             <tr>
          <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="pid[]" value="58" />
           {$val.n_id}</td>
       
          <td>{$val.n_name}</td>
       
		  <td><font color="#00CC99"  bgid="58"  class='is_show'>{$val.n_address}</font></td>


          <td><img src="/uploads/{$val.photo}" width="100" /></td>
 
		            
					         
          <td><div class="button-group"> <a class="button border-main" href="{:url('number/upda',['n_id'=>$val.n_id])}"><span class="icon-edit"></span> 修改</a> <a class="button border-red" href="delPro.php?pid=58" onclick="return confirm('您确定要删除吗?')"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
   		         {/foreach}
   		      
      <tr><td colspan="8"><div class="pagelist">{$page|raw}</div></td>


    
    </table>
  </div></form>
 
<script type="text/javascript">
   
   $(function(){
     $(".is_show").click(function(){
		  var pid=$(this).attr('bgid');
		  var offer=$(this);
		  var is_show=$(this).text();			  	 
	      $.get('change.php',{pid:pid,is_show:is_show},function(data){	        
	            offer.text(data);	
         });
	 
	 });
   
   });
 


 

//搜索
function changesearch(){	
		
}

//单个删除
 

//全选
$("#checkall").click(function(){ 
  $("input[name='pid[]']").each(function(){
	  if (this.checked) {
		  this.checked = false;
	  }
	  else {
		  this.checked = true;
	  }
  });
})

//批量删除
function DelSelect(){
	var Checkbox=false;
	 $("input[name='pid[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		var t=confirm("您确认要删除选中的内容吗？");
		if (t==false) return false;		

		$("#listform").attr('action','delAllPro.php');
		$("#listform").submit();		
	}
	else{
		alert("请选择您要删除的内容!");
		return false;
	}
}

//批量排序
function sorts(){ 	
		$("#listform").attr('action','list.php?type=sort');
		$("#listform").submit();	 
}


//批量首页显示
function changeishome(o){
	var Checkbox=false;
	 $("input[name='pid[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");		
	
		return false;
	}
}

//批量推荐
function changeisvouch(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");	
		
		return false;
	}
}

//批量置顶
function changeistop(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){		
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");		
	
		return false;
	}
}


//批量移动
function changecate(o){
	var Checkbox=false;
	 $("input[name='pid[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){		
		$("#listform").attr('action','list.php?type=change');		
		$("#listform").submit();		
	}
	else{
		alert("请选择要操作的内容!");
		
		return false;
	}
}

//批量复制
function changecopy(o){
	var Checkbox=false;
	 $("input[name='pid[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){	
		var i = 0;
	    $("input[name='pid[]']").each(function(){
	  		if (this.checked==true) {
				i++;
			}		
	    });
		if(i>0){ 
			$("#listform").attr('action','list.php?type=copy');		
	    	$("#listform").submit();		
		}else{
		    alert("请选择要复制的内容!");
			//$("#listform").submit();		
		}	
	}
	else{
		alert("请选择要复制的内容!");
		$(o).find("option:first").prop("selected","selected");
		return false;
	}
}

</script>
</body>
</html>